(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
mul0(C(x, y), y') → add0(mul0(y, y'), y')
mul0(Z, y) → Z
add0(C(x, y), y') → add0(y, C(S, y'))
add0(Z, y) → y
second(C(x, y)) → y
isZero(C(x, y)) → False
isZero(Z) → True
goal(xs, ys) → mul0(xs, ys)
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
mul0(C(x, y), y') → add0(mul0(y, y'), y')
mul0(Z, y) → Z
add0(C(x, y), y') → add0(y, C(S, y'))
add0(Z, y) → y
second(C(x, y)) → y
isZero(C(x, y)) → False
isZero(Z) → True
goal(xs, ys) → mul0(xs, ys)
S is empty.
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
mul0(C(x, y), y') → add0(mul0(y, y'), y')
mul0(Z, y) → Z
add0(C(x, y), y') → add0(y, C(S, y'))
add0(Z, y) → y
second(C(x, y)) → y
isZero(C(x, y)) → False
isZero(Z) → True
goal(xs, ys) → mul0(xs, ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
mul0,
add0They will be analysed ascendingly in the following order:
add0 < mul0
(6) Obligation:
Innermost TRS:
Rules:
mul0(
C(
x,
y),
y') →
add0(
mul0(
y,
y'),
y')
mul0(
Z,
y) →
Zadd0(
C(
x,
y),
y') →
add0(
y,
C(
S,
y'))
add0(
Z,
y) →
ysecond(
C(
x,
y)) →
yisZero(
C(
x,
y)) →
FalseisZero(
Z) →
Truegoal(
xs,
ys) →
mul0(
xs,
ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
Generator Equations:
gen_C:Z4_1(0) ⇔ Z
gen_C:Z4_1(+(x, 1)) ⇔ C(S, gen_C:Z4_1(x))
The following defined symbols remain to be analysed:
add0, mul0
They will be analysed ascendingly in the following order:
add0 < mul0
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
add0(
gen_C:Z4_1(
n6_1),
gen_C:Z4_1(
b)) →
gen_C:Z4_1(
+(
n6_1,
b)), rt ∈ Ω(1 + n6
1)
Induction Base:
add0(gen_C:Z4_1(0), gen_C:Z4_1(b)) →RΩ(1)
gen_C:Z4_1(b)
Induction Step:
add0(gen_C:Z4_1(+(n6_1, 1)), gen_C:Z4_1(b)) →RΩ(1)
add0(gen_C:Z4_1(n6_1), C(S, gen_C:Z4_1(b))) →IH
gen_C:Z4_1(+(+(b, 1), c7_1))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
mul0(
C(
x,
y),
y') →
add0(
mul0(
y,
y'),
y')
mul0(
Z,
y) →
Zadd0(
C(
x,
y),
y') →
add0(
y,
C(
S,
y'))
add0(
Z,
y) →
ysecond(
C(
x,
y)) →
yisZero(
C(
x,
y)) →
FalseisZero(
Z) →
Truegoal(
xs,
ys) →
mul0(
xs,
ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
Lemmas:
add0(gen_C:Z4_1(n6_1), gen_C:Z4_1(b)) → gen_C:Z4_1(+(n6_1, b)), rt ∈ Ω(1 + n61)
Generator Equations:
gen_C:Z4_1(0) ⇔ Z
gen_C:Z4_1(+(x, 1)) ⇔ C(S, gen_C:Z4_1(x))
The following defined symbols remain to be analysed:
mul0
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
mul0(
gen_C:Z4_1(
n534_1),
gen_C:Z4_1(
b)) →
gen_C:Z4_1(
*(
n534_1,
b)), rt ∈ Ω(1 + b·n534
12 + n534
1)
Induction Base:
mul0(gen_C:Z4_1(0), gen_C:Z4_1(b)) →RΩ(1)
Z
Induction Step:
mul0(gen_C:Z4_1(+(n534_1, 1)), gen_C:Z4_1(b)) →RΩ(1)
add0(mul0(gen_C:Z4_1(n534_1), gen_C:Z4_1(b)), gen_C:Z4_1(b)) →IH
add0(gen_C:Z4_1(*(c535_1, b)), gen_C:Z4_1(b)) →LΩ(1 + b·n5341)
gen_C:Z4_1(+(*(n534_1, b), b))
We have rt ∈ Ω(n3) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n3).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
mul0(
C(
x,
y),
y') →
add0(
mul0(
y,
y'),
y')
mul0(
Z,
y) →
Zadd0(
C(
x,
y),
y') →
add0(
y,
C(
S,
y'))
add0(
Z,
y) →
ysecond(
C(
x,
y)) →
yisZero(
C(
x,
y)) →
FalseisZero(
Z) →
Truegoal(
xs,
ys) →
mul0(
xs,
ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
Lemmas:
add0(gen_C:Z4_1(n6_1), gen_C:Z4_1(b)) → gen_C:Z4_1(+(n6_1, b)), rt ∈ Ω(1 + n61)
mul0(gen_C:Z4_1(n534_1), gen_C:Z4_1(b)) → gen_C:Z4_1(*(n534_1, b)), rt ∈ Ω(1 + b·n53412 + n5341)
Generator Equations:
gen_C:Z4_1(0) ⇔ Z
gen_C:Z4_1(+(x, 1)) ⇔ C(S, gen_C:Z4_1(x))
No more defined symbols left to analyse.
(13) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n3) was proven with the following lemma:
mul0(gen_C:Z4_1(n534_1), gen_C:Z4_1(b)) → gen_C:Z4_1(*(n534_1, b)), rt ∈ Ω(1 + b·n53412 + n5341)
(14) BOUNDS(n^3, INF)
(15) Obligation:
Innermost TRS:
Rules:
mul0(
C(
x,
y),
y') →
add0(
mul0(
y,
y'),
y')
mul0(
Z,
y) →
Zadd0(
C(
x,
y),
y') →
add0(
y,
C(
S,
y'))
add0(
Z,
y) →
ysecond(
C(
x,
y)) →
yisZero(
C(
x,
y)) →
FalseisZero(
Z) →
Truegoal(
xs,
ys) →
mul0(
xs,
ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
Lemmas:
add0(gen_C:Z4_1(n6_1), gen_C:Z4_1(b)) → gen_C:Z4_1(+(n6_1, b)), rt ∈ Ω(1 + n61)
mul0(gen_C:Z4_1(n534_1), gen_C:Z4_1(b)) → gen_C:Z4_1(*(n534_1, b)), rt ∈ Ω(1 + b·n53412 + n5341)
Generator Equations:
gen_C:Z4_1(0) ⇔ Z
gen_C:Z4_1(+(x, 1)) ⇔ C(S, gen_C:Z4_1(x))
No more defined symbols left to analyse.
(16) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n3) was proven with the following lemma:
mul0(gen_C:Z4_1(n534_1), gen_C:Z4_1(b)) → gen_C:Z4_1(*(n534_1, b)), rt ∈ Ω(1 + b·n53412 + n5341)
(17) BOUNDS(n^3, INF)
(18) Obligation:
Innermost TRS:
Rules:
mul0(
C(
x,
y),
y') →
add0(
mul0(
y,
y'),
y')
mul0(
Z,
y) →
Zadd0(
C(
x,
y),
y') →
add0(
y,
C(
S,
y'))
add0(
Z,
y) →
ysecond(
C(
x,
y)) →
yisZero(
C(
x,
y)) →
FalseisZero(
Z) →
Truegoal(
xs,
ys) →
mul0(
xs,
ys)
Types:
mul0 :: C:Z → C:Z → C:Z
C :: S → C:Z → C:Z
add0 :: C:Z → C:Z → C:Z
Z :: C:Z
S :: S
second :: C:Z → C:Z
isZero :: C:Z → False:True
False :: False:True
True :: False:True
goal :: C:Z → C:Z → C:Z
hole_C:Z1_1 :: C:Z
hole_S2_1 :: S
hole_False:True3_1 :: False:True
gen_C:Z4_1 :: Nat → C:Z
Lemmas:
add0(gen_C:Z4_1(n6_1), gen_C:Z4_1(b)) → gen_C:Z4_1(+(n6_1, b)), rt ∈ Ω(1 + n61)
Generator Equations:
gen_C:Z4_1(0) ⇔ Z
gen_C:Z4_1(+(x, 1)) ⇔ C(S, gen_C:Z4_1(x))
No more defined symbols left to analyse.
(19) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add0(gen_C:Z4_1(n6_1), gen_C:Z4_1(b)) → gen_C:Z4_1(+(n6_1, b)), rt ∈ Ω(1 + n61)
(20) BOUNDS(n^1, INF)